#include "QtMapSelector.h" 

QtMapSelector::QtMapSelector(QWidget *parent): QWidget(parent)
{
	ui.setupUi(this);
	
	QObject::connect(ui.buttonBox, SIGNAL(accepted()), this,  SLOT(OnConfirm()));
	QObject::connect(ui.buttonBox, SIGNAL(rejected()), this,  SLOT(OnCancel()));
	QObject::connect(ui.leftButton, SIGNAL(clicked()), ui.catalogusViewer, SLOT(showPreviousEvent()));
	QObject::connect(ui.rightButton, SIGNAL(clicked()), ui.catalogusViewer, SLOT(showNextEvent()));
}

QtMapSelector::~QtMapSelector()
{
	qDebug("Destructing mapselector");
}

void QtMapSelector::GetMap()
{
	show();
}

void QtMapSelector::paintEvent(QPaintEvent *)
{
	QPainter painter(this);

	//painter.setBrush(Qt::red);
	//painter.drawRect(rect());
}

void QtMapSelector::OnConfirm()
{
	hide();
	NotifySelectedMap();
}

void QtMapSelector::OnCancel()
{
	hide();
	NotifyCancelled();
}
